/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_Studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once

#include "基本类型.h"


#if !defined (_WIN32) && !defined (_WIN64)  
#define LINUX  
#include <sysconf.h>  
#else  
#define WINDOWS  
#include <windows.h>  
#endif  
inline uint32 f_getCPU核数()
{
	uint32 count = 1; // 至少一个  
#if defined (LINUX)  
	count = sysconf(_SC_NPROCESSORS_CONF);
#elif defined (WINDOWS)  
	SYSTEM_INFO si;
	GetSystemInfo(&si);
	count = si.dwNumberOfProcessors;
#endif  
	return count;
}


